package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)"`
	Password string `gorm:"type:varchar(50)"`
}

type Novel struct {
	gorm.Model
	Title   string `gorm:"type:varchar(50)"`
	Content string `gorm:"type:varchar(50)"`
	Author  string `gorm:"type:varchar(50)"`
}

/////////////////RBAC权限业务////////////

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int"`
	Rid int `gorm:"type:int"`
}

type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(50)"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int"`
	Nid int `gorm:"type:int"`
}

type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(50)"`
}

// ///////////////////车辆后台权限//////////////
type CarRole struct {
	gorm.Model
	RoleCode string `gorm:"type:varchar(50)"`
	RoleName string `gorm:"type:varchar(50)"`
}

type CarNode struct {
	gorm.Model
	NodeName  string `gorm:"type:varchar(50)"`
	NodeGrade int    `gorm:"type:int"`
	NodeType  string `gorm:"type:varchar(50)"`
	CarRoleId int    `gorm:"type:int"`
}

type CarNodeList struct {
	CarNodeId int    `gorm:"type:int"`
	RoleCode  string `gorm:"type:varchar(50)"`
	RoleName  string `gorm:"type:varchar(50)"`
	NodeName  string `gorm:"type:varchar(50)"`
	NodeGrade int    `gorm:"type:int"`
	NodeType  string `gorm:"type:varchar(50)"`
}

// //////////////////车辆交易合同///////////////
type CarCon struct {
	gorm.Model
	CarName  string `gorm:"type:varchar(50)"`
	CarType  string `gorm:"type:varchar(50)"`
	CarPrice int    `gorm:"type:int"`
}

type CarContract struct {
	gorm.Model
	ContractCode    string `gorm:"type:varchar(50)"`
	ContractContent string `gorm:"type:varchar(50)"`
	ContractStatus  string `gorm:"type:varchar(50)"`
	CarConId        int    `gorm:"type:int"`
}

type CarContractList struct {
	ContractId      int    `gorm:"type:int"`
	CarName         string `gorm:"type:varchar(50)"`
	CarType         string `gorm:"type:varchar(50)"`
	CarPrice        int    `gorm:"type:int"`
	ContractCode    string `gorm:"type:varchar(50)"`
	ContractContent string `gorm:"type:varchar(50)"`
	ContractStatus  string `gorm:"type:varchar(50)"`
}

// ///////////////车辆交易订单/////////////
type SmallCar struct {
	gorm.Model
	CarCode  string `gorm:"type:varchar(50)"`
	CarName  string `gorm:"type:varchar(50)"`
	CarPrice int    `gorm:"type:int"`
}

type CarOrder struct {
	gorm.Model
	OrderCode   string `gorm:"type:varchar(50)"`
	OrderStatus string `gorm:"type:varchar(50)"`
	OrderBz     string `gorm:"type:varchar(50)"`
	CarId       int    `gorm:"type:int"`
}

type CarOrderList struct {
	OrderId     int    `gorm:"type:int"`
	CarCode     string `gorm:"type:varchar(50)"`
	CarName     string `gorm:"type:varchar(50)"`
	CarPrice    int    `gorm:"type:int"`
	OrderCode   string `gorm:"type:varchar(50)"`
	OrderStatus string `gorm:"type:varchar(50)"`
	OrderBz     string `gorm:"type:varchar(50)"`
}

////////////////////车辆数据信息管理//////////////////

type NewCar struct {
	gorm.Model
	CarName string `gorm:"type:varchar(50)"`
	CarType string `gorm:"type:varchar(50)"`
	CarCode string `gorm:"type:varchar(50)"`
}

type CarData struct {
	gorm.Model
	DataName    string `gorm:"type:varchar(50)"`
	DataContent string `gorm:"type:varchar(50)"`
	DataNum     int    `gorm:"type:int"`
	NewCarId    int    `gorm:"type:int"`
}

type CarDataList struct {
	DataId      int    `gorm:"type:int"`
	CarName     string `gorm:"type:varchar(50)"`
	CarType     string `gorm:"type:varchar(50)"`
	CarCode     string `gorm:"type:varchar(50)"`
	DataName    string `gorm:"type:varchar(50)"`
	DataContent string `gorm:"type:varchar(50)"`
	DataNum     int    `gorm:"type:int"`
}

// ////////////////物流配送管理////////////////
type Delivery struct {
	gorm.Model
	DelCode  string `gorm:"type:varchar(50)"`
	DelName  string `gorm:"type:varchar(50)"`
	DelPhone int    `gorm:"type:varchar(50)"`
}

type DeliveryOrder struct {
	gorm.Model
	OrderCode  string `gorm:"type:varchar(50)"`
	OrderPlace string `gorm:"type:varchar(50)"`
	OrderNum   int    `gorm:"type:varchar(50)"`
	DelId      int    `gorm:"type:int"`
}

type DeliveryOrderList struct {
	OrderId    int    `gorm:"type:int"`
	DelCode    string `gorm:"type:varchar(50)"`
	DelName    string `gorm:"type:varchar(50)"`
	DelPhone   int    `gorm:"type:varchar(50)"`
	OrderCode  string `gorm:"type:varchar(50)"`
	OrderPlace string `gorm:"type:varchar(50)"`
	OrderNum   int    `gorm:"type:varchar(50)"`
}

// /////////////////物流仓库管理////////////////
type WareHouse struct {
	gorm.Model
	WareCode string `gorm:"type:varchar(50)"`
	WareName string `gorm:"type:varchar(50)"`
	WareType string `gorm:"type:varchar(50)"`
}

type WareHouseManage struct {
	gorm.Model
	ManageCode  string `gorm:"type:varchar(50)"`
	ManagePlace string `gorm:"type:varchar(50)"`
	ManageName  string `gorm:"type:varchar(50)"`
	Wid         int    `gorm:"type:int"`
}

type WareHouseManageList struct {
	ManageId    int    `gorm:"type:int"`
	WareCode    string `gorm:"type:varchar(50)"`
	WareName    string `gorm:"type:varchar(50)"`
	WareType    string `gorm:"type:varchar(50)"`
	ManageCode  string `gorm:"type:varchar(50)"`
	ManagePlace string `gorm:"type:varchar(50)"`
	ManageName  string `gorm:"type:varchar(50)"`
}

// /////////////////物流后台权限/////////////////
type PerRole struct {
	gorm.Model
	RoleName  string `gorm:"type:varchar(50)"`
	RolePer   string `gorm:"type:varchar(50)"`
	RoleGrade int    `gorm:"type:int"`
}

type Permission struct {
	gorm.Model
	PerType string `gorm:"type:varchar(50)"`
	PerName string `gorm:"type:varchar(50)"`
	PerImg  string `gorm:"type:varchar(50)"`
	Rid     int    `gorm:"type:int"`
}

type PermissionList struct {
	PerId     int    `gorm:"type:int"`
	RoleName  string `gorm:"type:varchar(50)"`
	RolePer   string `gorm:"type:varchar(50)"`
	RoleGrade int    `gorm:"type:int"`
	PerType   string `gorm:"type:varchar(50)"`
	PerName   string `gorm:"type:varchar(50)"`
	PerImg    string `gorm:"type:varchar(50)"`
}

// ///////////////////电商后台权限////////////////
type CommerceRole struct {
	gorm.Model
	RoleCode   string `gorm:"type:varchar(50)"`
	RoleName   string `gorm:"type:varchar(50)"`
	RoleCreate string `gorm:"type:varchar(50)"`
}

type CommercePer struct {
	gorm.Model
	PerType string `gorm:"type:varchar(50)"`
	PerName string `gorm:"type:varchar(50)"`
	Rid     int    `gorm:"type:varchar(50)"`
}

type CommercePerList struct {
	Pid        int    `gorm:"type:int"`
	RoleCode   string `gorm:"type:varchar(50)"`
	RoleName   string `gorm:"type:varchar(50)"`
	RoleCreate string `gorm:"type:varchar(50)"`
	PerType    string `gorm:"type:varchar(50)"`
	PerName    string `gorm:"type:varchar(50)"`
}
